import axios from 'axios';
import Element from 'element-ui';
import './message.css';

let int = axios.create({
    baseURL: 'https://www.rice777.cn/api'
});

int.interceptors.response.use(function (res){
    if(res.status === 200) {
        return res.data.result;
    } else {
        Element.Message({
            message : '发生错误',
            type : 'error',
            showClose : true,
            customClass: 'msg',
            duration: 2000
        })
    }
}, function (){
    Element.Message({
        message : '发生错误',
        type : 'error',
        showClose : true,
        customClass: 'msg',
        duration: 2000
    })
})

export default int



